package com.plian.system.entity.im;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @description: 投资计划主要字段表
 * @author: gangan
 * @create: 2020-04-23 16:27
 */
@Data
@TableName("im_base_investment_plan")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "投资计划", description = "投资计划")
public class BaseInvestmentPlan extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    private String code;
    @ApiModelProperty(value = "是否政府性项目 2 是 1否")
    private Integer isGov;
    /**
     * 填报单位
     */
    @ApiModelProperty(value = "填报单位")
    private String filingUnitId;
    /**
     * 填报年度
     */
    @ApiModelProperty(value = "填报年度", required = true)
    private String filingYear;

    /**
     * 填报日期
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @ApiModelProperty(value = "填报日期", required = true)
    private Date filingDate;

    /**
     * 审批人
     */
    @ApiModelProperty(value = "审批人")
    private String approvedUser;

    /**
     * 审批时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "审批时间")
    private Date approvedTime;

    /**
     * 审批意见
     */
    @ApiModelProperty(value = "审批意见")
    private String approvedOpinion;

    /**
     * 流程实例id
     */
    @ApiModelProperty(value = "单据类型")
    private String formType;

    @TableField(exist = false)
    private List<FixedInvestmentPlan> fixedInvestmentPlans;

    @TableField(exist = false)
    private List<StakeInvestmentPlan> stakeInvestmentPlans;

    /**
     * 数据来源 null为系统填报 对应用户id
     */
    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
    private String dataSource;

    /**
     * 数据来源id
     */
    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

    @ApiModelProperty(value = "附件")
    @TableField(exist = false)
    private List<HashMap> docList;

    @ApiModelProperty(value = "投资规模（备案口径)")
    private BigDecimal investmentScale;

    @ApiModelProperty(value = "其中：固定资产（备案口径)")
    private BigDecimal fixedAssets;

    @ApiModelProperty(value = "其中：股权投资（备案口径）")
    private BigDecimal equityInvestment;

    @ApiModelProperty(value = "本年计划投资总额")
    private BigDecimal plannedInvestment;

    @ApiModelProperty(value = "其他投资金额")
    private BigDecimal otherInvestment;

    @ApiModelProperty(value = "投资项目总个数")
    private Integer projectTotal;

    @ApiModelProperty(value = "投资主要方向")
    private String investmentDirection;

    @ApiModelProperty(value = "投资主要目的")
    private String investmentPurpose;

    @ApiModelProperty(value = "备案Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long recordId;
}
